package org.beetl.sql.core.mapping;

import java.util.Map;

public class PojoResultSetRowMapperCache {

 private static Map<String, PojoResultSetRowMapper> CACHE = new java.util.concurrent.ConcurrentHashMap<String, PojoResultSetRowMapper>();

 public static PojoResultSetRowMapper get(@SuppressWarnings("rawtypes") Class returnType, boolean caseSensitive) {
  String cacheKey = returnType.getName() + "." + caseSensitive;
  if (CACHE.containsKey(cacheKey)) {
   return CACHE.get(cacheKey);
  } else {
   PojoResultSetRowMapper instance = new PojoResultSetRowMapper(returnType, caseSensitive);
   CACHE.put(cacheKey, instance);
   return instance;
  }
 }
}
